import pymysql
connect = pymysql.connect(user='root',password='root',host='localhost',database='school',charset='utf8')
cursor = connect.cursor()
sql = "select * from students limit 2"
cursor.execute(sql)
result = cursor.fetchall()
print(result)
cursor.close()
connect.close()